<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of user
 *
 * @author MASTER
 */
class user extends AppModel {

    //put your code here
    public $name = "user";
    public $hasMany = "venta";

    public function beforeSave($options = array()) {

        if(isset($this->data['user']['password']) ){
        $this->data['user']['password'] = Security::hash($this->data['user']['password'], null, true);
        
        }
        if(isset($this->data['user']['rut'])){
        $this->data['user']['codigo'] = Security::hash($this->data['user']['rut'], null, true);
        }
        return true;
    }

}

?>
